package org.dromara.business.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.business.domain.Goods;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.json.handler.DecimalRemoveZeroSerializer;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;


/**
 * 商城商品视图对象 goods
 *
 * @author Lion Li
 * @date 2025-05-18
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = Goods.class)
public class GoodsVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 商品编号
     */
    @ExcelProperty(value = "商品编号")
    private Long goodsId;

    /**
     * 商品名称
     */
    @ExcelProperty(value = "商品名称")
    private String name;

    /**
     * 商品图片id
     */
    @ExcelProperty(value = "商品图片")
    private String url;
    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "url")
    private String urlLink;

    /**
     * 商品价格
     */
    @ExcelProperty(value = "商品价格")
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal price;

    /**
     * 会员价
     */
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal vipPrice;

    /**
     * 状态（0正常 1停用）
     */
    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_yes_no")
    private String status;

    /**
     * 商品介绍
     */
    @ExcelProperty(value = "商品介绍")
    private String info;

    /**
     * 详情
     */
    @ExcelProperty(value = "详情")
    private String infoDesc;

    /**
     * 销量
     */
    @ExcelProperty(value = "销量")
    private Integer num;
    //限购数量
    private Integer buyLimit;
    /**
     * 分类
     */
    @ExcelProperty(value = "分类")
    private String type;

    private String oneType;
    private Long oneTypeId;

    //  游戏区服 - 线隔开
    private String gameArea;

    /**
     * 可用优惠券
     */
    private List<CouponVo> couponVoList;

}
